package com.lin.springbootthymeleaf.controller;

import com.lin.springbootthymeleaf.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.Banner;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class UserController {
    @Autowired
    private UserService userService;

    @GetMapping("/list")
    public String getUserList(Model model) {
        model.addAttribute("userList", userService.getUserList());
        return "list";
    }
}
